﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Class1 k = new Class1();
            k.zhanghao = 135790;
            k.yonghuming = 134;
            k.mima = 135790;
            k.EoL8();
        }
        static void EoL1()
        {
            Console.WriteLine("请输入正方形的边长");
            int a = int.Parse(Console.ReadLine());
            string[,] b = new string[a, a];
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    b[i, j] = "*" + " ";
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    Console.Write(b[i, j]);
                }
                Console.WriteLine();
            }
        }
        static void EoL2()
        {
            string[,] a = new string[9, 9];
            for (int i = 0; i < a.GetLength(0); i++)
            {
                for (int j = 0; j < a.GetLength(1); j++)
                {
                    a[i, j] = (i + 1) + "*" + (j + 1) + "=" + ((i + 1) * (j + 1)) + "\t";
                }
            }
            for (int i = 0; i < a.GetLength(0); i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    Console.Write(a[i, j]);
                }
                Console.WriteLine();
            }
        }
        static void EoL3()
        {
            Console.WriteLine("请输入空心正方形的边长");
            int a = int.Parse(Console.ReadLine());
            string[,] b = new string[a, a];
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    if (i >= 1 && i <= a - 2 && j >= 1 && j <= a - 2)
                    {
                        b[i, j] = " " + " ";
                    }
                    else
                    {
                        b[i, j] = "*" + " ";
                    }
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    Console.Write(b[i, j]);
                }
                Console.WriteLine();
            }
        }
        static void EoL4()
        {
            Console.WriteLine("请输入菱形的边长");
            int a = int.Parse(Console.ReadLine());
            string[,] b = new string[a * 2, a * 2];
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    if (i <= a && j > a - i && j < a + i || a < i && j > i - a && j <= 3 * a - 1 - i)
                    {
                        b[i, j] = " *";
                    }
                    else
                    {
                        b[i, j] = "  ";
                    }
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    Console.Write(b[i, j]);
                }
                Console.WriteLine();
            }

        }
        static void EoL5()
        {
            int[] a = { 10, 8, 6, 4, 2 };
            int[] c = new int[6];
            Console.WriteLine("输入一个数");
            int b = int.Parse(Console.ReadLine());
            for (int i = 0; i < a.Length; i++)
            {
                c[i] = a[i];
            }
            c[5] = b;
            Array.Sort(c);
            Array.Reverse(c);
            for (int i = 0; i < c.Length; i++)
            {
                Console.Write(c[i]+" ");
            }
        }
        static void EoL6()
        {
            string[] a = { "ab", "cd", "ef", "gh", "ij" };
            for (int i = 0; i < a.Length; i++)
            {
                if (i%2==0)
                {
                    Console.Write(a[i]+" ");
                }
            }
        }
        static void EoL7() 
        {
            Console.WriteLine("生成几行");
            int a = int.Parse(Console.ReadLine());
            int[,] b = new int[a, a];
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j <= i; j++)
                {
                    if (j == 0)
                    {
                        b[i, j] =1;
                    }
                    else if (j == i)
                    {
                        b[i, j] = 1;
                    }
                    else if (i>=2)
                    {
                        b[i, j] = b[i-1, j - 1] + b[i - 1, j];
                    }
                }
            }
            for (int i = 0; i < b.GetLength(0); i++)
            {
                for (int j = 0; j < b.GetLength(1); j++)
                {
                    if (b[i,j]!=0)
                    {
                        Console.Write(b[i, j] + " "+"\t");
                    }
                }
                Console.WriteLine();
            }
        }

    }
}
